/*
███████╗██╗   ██╗ ██████╗██╗  ██╗
██╔════╝██║   ██║██╔════╝██║ ██╔╝
█████╗  ██║   ██║██║     █████╔╝
██╔══╝  ██║   ██║██║     ██╔═██╗
██║     ╚██████╔╝╚██████╗██║  ██╗
╚═╝      ╚═════╝  ╚═════╝╚═╝  ╚═╝
*/

package common.JavaBean;

import java.math.BigDecimal;
import java.util.Date;

public class Payment {

    private String paymentId;      // 支付ID (例如，一个UUID)
    private String orderId;        // 关联的订单ID
    private BigDecimal amount;     // 支付金额 (用 BigDecimal 处理钱最精确，避免浮点数误差)
    private String paymentMethod;  // 支付方式 (例如 "Alipay", "WeChat Pay")
    private Date paymentTime;      // 支付时间
    private String paymentStatus;  // 支付状态 (例如 "SUCCESS", "PENDING", "FAILED")

    // --- 构造方法 (Constructors) ---

    /**
     *  一个空的构造方法是 JavaBean 的标配。
     *  很多框架（比如 Spring）在创建对象时都需要它。
     */
    public Payment() {
    }

    /**
     * 一个全参数的构造方法，方便我们快速创建对象。
     */
    public Payment(String paymentId, String orderId, BigDecimal amount, String paymentMethod, Date paymentTime, String paymentStatus) {
        this.paymentId = paymentId;
        this.orderId = orderId;
        this.amount = amount;
        this.paymentMethod = paymentMethod;
        this.paymentTime = paymentTime;
        this.paymentStatus = paymentStatus;
    }

    // --- Getters and Setters ---
    // 快捷键：在 IDEA 里按 Alt + Insert -> Getter and Setter

    public String getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(String paymentId) {
        this.paymentId = paymentId;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public Date getPaymentTime() {
        return paymentTime;
    }

    public void setPaymentTime(Date paymentTime) {
        this.paymentTime = paymentTime;
    }

    public String getPaymentStatus() {
        return paymentStatus;
    }

    public void setPaymentStatus(String paymentStatus) {
        this.paymentStatus = paymentStatus;
    }

    // 方便我们打印对象信息进行调试，不然直接打印 Payment 对象只会得到一串内存地址。
    // 快捷键：Alt + Insert -> toString()
    @Override
    public String toString() {
        return "Payment{" +
                "paymentId='" + paymentId + '\'' +
                ", orderId='" + orderId + '\'' +
                ", amount=" + amount +
                ", paymentMethod='" + paymentMethod + '\'' +
                ", paymentTime=" + paymentTime +
                ", paymentStatus='" + paymentStatus + '\'' +
                '}';
    }
}
